#!/usr/bin/python

from urllib import parse
import sys
import io
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
import time
import requests
import json
import urllib
import re

def getpara(para):
    url = "http://47.99.139.72:8888/callback?" + para
    baseinfo = urllib.request.urlopen(url, data=None, timeout=10)
    data = json.loads(baseinfo.read().decode())
    return data
#{'code': '200', 'data': {'hub': 'qingning-live-sec', 'streamId': 'z1.test.stream1', 'stream': '123456', 'rate': '0.9', 'time': '123411111', 'ts': '333333.ts', 'label': 'sexy', 'review': 'true'}}
paras = "hub=qingning-live-sec&streamId=z1.test.stream1&stream=123456&rate=0.9&time=123411111&ts=333333.ts&label=sexy&review=true"

mobile = sys.argv[1]
webhook = "https://oapi.dingtalk.com/robot/send?access_token=bd38f7e0be7a15dd0db6d8d89a9bff3d722ad96c763a7492ce5a5c0822729744"

params = getpara(paras) 
print(params)

